package abs.service;

import abs.domain.Clientes;
import abs.domain.Companias;
import abs.domain.TipoClientes;

import java.util.List;
import java.util.Set;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;

import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;

import org.springframework.test.context.transaction.TransactionalTestExecutionListener;

import org.springframework.transaction.annotation.Transactional;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Class to run the service as a JUnit test. Each operation in the service is a separate test.
 *
 */

@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners({
		DependencyInjectionTestExecutionListener.class,
		DirtiesContextTestExecutionListener.class,
		TransactionalTestExecutionListener.class })
@ContextConfiguration(locations = {
		"file:./resources/absWeb-security-context.xml",
		"file:./resources/absWeb-service-context.xml",
		"file:./resources/absWeb-dao-context.xml",
		"file:./resources/absWeb-web-context.xml" })
@Transactional
public class TipoClientesServiceTest {

	/**
	 * The Spring application context.
	 *
	 */
	@SuppressWarnings("unused")
	private ApplicationContext context;

	/**
	 * The service being tested, injected by Spring.
	 *
	 */
	@Autowired
	protected TipoClientesService service;

	/**
	 * Instantiates a new TipoClientesServiceTest.
	 *
	 */
	public TipoClientesServiceTest() {
		setupRequestContext();
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Companias entity
	 * 
	 */
	@Test
	public void deleteTipoClientesCompanias() {
		// TODO: JUnit - Populate test inputs for operation: deleteTipoClientesCompanias 
		String tipoclientes_tipocl100cdgo = null;
		String related_companias_co000nocia = null;
		TipoClientes response = null;
		response = service.deleteTipoClientesCompanias(tipoclientes_tipocl100cdgo, related_companias_co000nocia);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteTipoClientesCompanias
	}

	/**
	 * Operation Unit Test
	 * Return a count of all TipoClientes entity
	 * 
	 */
	@Test
	public void countTipoClientess() {
		Integer response = null;
		response = service.countTipoClientess();
		// TODO: JUnit - Add assertions to test outputs of operation: countTipoClientess
	}

	/**
	 * Operation Unit Test
	 * Save an existing TipoClientes entity
	 * 
	 */
	@Test
	public void saveTipoClientes() {
		// TODO: JUnit - Populate test inputs for operation: saveTipoClientes 
		TipoClientes tipoclientes = new abs.domain.TipoClientes();
		service.saveTipoClientes(tipoclientes);
	}

	/**
	 * Operation Unit Test
	 * Load an existing TipoClientes entity
	 * 
	 */
	@Test
	public void loadTipoClientess() {
		Set<TipoClientes> response = null;
		response = service.loadTipoClientess();
		// TODO: JUnit - Add assertions to test outputs of operation: loadTipoClientess
	}

	/**
	 * Operation Unit Test
	 * Save an existing Clientes entity
	 * 
	 */
	@Test
	public void saveTipoClientesClienteses() {
		// TODO: JUnit - Populate test inputs for operation: saveTipoClientesClienteses 
		String tipocl100cdgo = null;
		Clientes related_clienteses = new abs.domain.Clientes();
		TipoClientes response = null;
		response = service.saveTipoClientesClienteses(tipocl100cdgo, related_clienteses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveTipoClientesClienteses
	}

	/**
	 * Operation Unit Test
	 */
	@Test
	public void findTipoClientesByPrimaryKey() {
		// TODO: JUnit - Populate test inputs for operation: findTipoClientesByPrimaryKey 
		String tipocl100cdgo_1 = null;
		TipoClientes response = null;
		response = service.findTipoClientesByPrimaryKey(tipocl100cdgo_1);
		// TODO: JUnit - Add assertions to test outputs of operation: findTipoClientesByPrimaryKey
	}

	/**
	 * Operation Unit Test
	 * Save an existing Companias entity
	 * 
	 */
	@Test
	public void saveTipoClientesCompanias() {
		// TODO: JUnit - Populate test inputs for operation: saveTipoClientesCompanias 
		String tipocl100cdgo_2 = null;
		Companias related_companias = new abs.domain.Companias();
		TipoClientes response = null;
		response = service.saveTipoClientesCompanias(tipocl100cdgo_2, related_companias);
		// TODO: JUnit - Add assertions to test outputs of operation: saveTipoClientesCompanias
	}

	/**
	 * Operation Unit Test
	 * Return all TipoClientes entity
	 * 
	 */
	@Test
	public void findAllTipoClientess() {
		// TODO: JUnit - Populate test inputs for operation: findAllTipoClientess 
		Integer startResult = 0;
		Integer maxRows = 0;
		List<TipoClientes> response = null;
		response = service.findAllTipoClientess(startResult, maxRows);
		// TODO: JUnit - Add assertions to test outputs of operation: findAllTipoClientess
	}

	/**
	 * Operation Unit Test
	 * Delete an existing TipoClientes entity
	 * 
	 */
	@Test
	public void deleteTipoClientes() {
		// TODO: JUnit - Populate test inputs for operation: deleteTipoClientes 
		TipoClientes tipoclientes_1 = new abs.domain.TipoClientes();
		service.deleteTipoClientes(tipoclientes_1);
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Clientes entity
	 * 
	 */
	@Test
	public void deleteTipoClientesClienteses() {
		// TODO: JUnit - Populate test inputs for operation: deleteTipoClientesClienteses 
		String tipoclientes_tipocl100cdgo_1 = null;
		Integer related_clienteses_cl100cocl = 0;
		TipoClientes response = null;
		response = service.deleteTipoClientesClienteses(tipoclientes_tipocl100cdgo_1, related_clienteses_cl100cocl);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteTipoClientesClienteses
	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Sets Up the Request context
	 *
	 */
	private void setupRequestContext() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
	}
}
